
import request from '@/utils/request'
const api_name_menu = '/menu'
export default {
  //账户登录获得菜单 已弃用
  getAllallMenu() {
    return request({
      url: `${api_name_menu}/findMenu`,
      method: 'get',
    })
  },
  //通过角色id获得权限
  getRoleMenu(roleId) {
    return request({
      url: `${api_name_menu}/findMenu/${roleId}`,
      method: 'get',
    })
  },
  //根据角色id 修改菜单
  setMenu(roleId, idsObj) {
    return request({
      url: `${api_name_menu}/setMenu/${roleId}`,
      method: 'put',
      data: idsObj
    })
  },
  //返回当前所有的父级菜单
  findAllFidMenu() {
    return request({
      url: `${api_name_menu}/findAllFidMenu`,
      method: 'get',
    })
  },

  //增加子集菜单
  addMenuSon(menuSonObj) {
    return request({
      url: `${api_name_menu}/addMenuSon`,
      method: 'post',
      data: menuSonObj
    })
  },
  addMenuFather(menuSonObj) {
    return request({
      url: `${api_name_menu}/addMenuFather`,
      method: 'post',
      data: menuSonObj
    })
  }



}

